package cn.doitedu.rtmk.demo7;

import com.googlecode.aviator.AviatorEvaluator;

import java.util.HashMap;
import java.util.Map;

public class AviatorTest {

    public static void main(String[] args) {

        int f1 = 20;
        int f2 = 20;
        int f3 = 30;

        Map<String, Object> env = new HashMap<>();
        env.put("f1", f1);
        env.put("f2", f2);
        env.put("f3", f3);

        String str = "f1 + f2 > f3 ";
        Boolean result = (Boolean) AviatorEvaluator.execute(str, env);
        System.out.println(result);


    }

}
